<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Test extends CI_Controller {

    private $fields = array('title','guides','description','excursion_text','addition','pickup_location');  
    
    function __construct()
    {
        parent::__construct();
    }

    function index()
    {
        $this->load->helper('url');

        /* Translate Class */
        $this->load->library('translate');

        /* Translate Language */
        $this->translate->setLang('me');

        $excursions = $this->db->get('excursions')->result_array();

        /* Translate */

        foreach($excursions as $key=>$value){
            foreach($this->fields as $f){
                $excursions[$key][$f] = $this->translate->getArray($value[$f], TRUE);
                if($excursions[$key][$f]=='')$excursions[$key][$f]='-Please translate-';
            }
        }


        $this->load->view('test',array('excursions'=>$excursions));

    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
